package com.ruoyi.product.es;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.annotation.Excel;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.data.elasticsearch.annotations.Setting;

import java.util.Date;

/**
 * @Author: 鑫仔
 * @Date: 2025/8/9 08:50
 * @Description:
 **/
@Data
@Document(indexName = "es_product")
@Setting(shards = 1,replicas = 0)
public class ProdEs {
    /** 商品ID */
    @Id
    @Field(type = FieldType.Keyword)
    private Integer prodId;

    /** SPU */
    @Field(type = FieldType.Keyword)
    private String prodSpu;

    /** 商品类型 */
    @Field(type = FieldType.Integer)
    private Integer prodKind;

    /** 商品分类 */
    @Field(type = FieldType.Integer)
    private Integer prodType;

    /** 状态 */
    @Field(type = FieldType.Integer)
    private Integer prodStatus;

    /** 商品名称 */
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String prodName;

    /** 商品品牌 */
    @Field(type = FieldType.Integer)
    private Integer brandId;

    /** 商品单位 */
    @Field(type = FieldType.Integer)
    private Integer unitId;

    /** 商品标签 */
    @Field(type = FieldType.Integer)
    private Integer tagId;

    /** 供应商 */
    @Field(type = FieldType.Keyword)
    private String appr;

    /** 缩略图 */
    @Field(type = FieldType.Keyword)
    private String prodImage;

    /** 品牌名称 */
    @Field(type = FieldType.Keyword)
    private String brandName;

    /** 分类名称 */
    @Field(type = FieldType.Keyword)
    private String typeName;

    /** 创建者 */
    @Field(type = FieldType.Keyword)
    private String createBy;

    /** 创建时间 */
    @Field(type = FieldType.Date,format = {},pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",shape = JsonFormat.Shape.STRING,timezone = "GMT+8")
    private Date createTime;

    /** 更新者 */
    @Field(type = FieldType.Keyword)
    private String updateBy;

    /** 更新时间 */
    @Field(type = FieldType.Date,format = {},pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",shape = JsonFormat.Shape.STRING,timezone = "GMT+8")
    private Date updateTime;
}
